<html>
    <head>
        <title>helloWorld</title>
        <meta charset="utf-8"/>
        
    </head>
    <style>
        * {
            margin: 0;
            padding: 0;
            word-spacing: 2px;
        }
        body {
            width: 500px;
            height: 350px;
            --theme: #f06161;
            --theme-hover: #c54c4c;
            --off-color: #b4b4b4;
        }
        .back-img {
            position: absolute;
            z-index: -1;
        }
        .popup-main {
            padding-top: 40px;
        }
        .popup-item {
            display: grid;
            grid-template-columns: 1fr 1.5fr;
            grid-column-gap: 50px;
            margin-bottom: 15px;
            align-items: center;
        }
        .popup-item p {
            font-size: 16px;
            text-align: right;
            justify-items: center;
        }
        .open-spine-label {
            height: 20px;
            width: 40px;
            border: 2px solid var(--off-color);
            border-radius: 15px;
            position: relative;
            background: var(--off-color);
            transition: .4s;
            cursor: pointer;
        }
        .open-spine-label::before {
            content: "";
            height: 20px;
            width: 20px;
            background: #fff;
            border-radius: 50%;
            position: absolute;
            left: 0;
            transition: .4s;
        }
        .popup-item input:checked + label {
            border-color: var(--theme);
            background: var(--theme);
        }
        .popup-item input:checked + label::before {
            left: 20px;
        }
        .select-spine-label {
            height: 30px;
            width: 200px;
            border: 1px solid #b4b4b4;
        }
        .spine-char-select {
            --select-height: 30px;
            height: var(--select-height);
            max-height: var(--select-height);
            overflow: hidden;
            width: 200px;
            background: #fff;
            display: flex;
            align-items: center;
            position: relative;
            border: 1px solid #888888;
            cursor: pointer;
            border-radius: 3px;
        }
        .spine-char-select::before {
            content: "";
            position: absolute;
            right: 15px;
            height: 8px;
            width: 8px;
            box-sizing: border-box;
            border-top: 4px solid #000;
            border-left: 4px solid #000;
            border-bottom: 4px solid transparent;
            border-right: 4px solid transparent;
            transform: rotate(-135deg) ;
            transition: .4s;
            margin-bottom: 4px;
        }
        .spine-char-select > input {
            border: none;
            outline: none;
            background: none;
            margin-left: 10px;
        }
        .spine-char-select-popup {
            opacity: 0;
            background: #fff;
            position: absolute;
            width: inherit;
            max-height: calc(var(--select-height) * 5 + 10px);
            top: 0;
            padding: 5px;
            border-radius: 5px;
            transition: .4s;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            box-shadow: 0 0 5px #b3b3b3;
            overflow-y: scroll;
            z-index: 99;
        }
        .spine-char-select-option {
            height: var(--select-height);
            min-height: var(--select-height);
            font-size: 16px;
            color: #303030;
            border-bottom: 1px solid #ececec;
            cursor: pointer;
            display: flex;
            align-items: center;
        }
        .spine-char-select-option > p {
            transition: .4s;
            display: block;
        }
        .spine-char-select-option:hover {
            background: #ececec;
        }
        .spine-char-select-option:hover > p {
            transform: translateX(15px);
        }
        .spine-char-select-popup::-webkit-scrollbar {
          width: 5px;
        }
        .spine-char-select-popup::-webkit-scrollbar-track {
          background-color: #fff;
          border-radius: 2px;
        }
        .spine-char-select-popup::-webkit-scrollbar-thumb {
          background-color: #d9dce3;
          border-radius: 2px;
        }
        .spine-char-select:hover {
            overflow: initial;
        }
        .spine-char-select:hover::before {
            transform: rotate(45deg);
            margin-bottom: -4px;
        }
        .spine-char-select:hover .spine-char-select-popup {
            opacity: 1;
            top: var(--select-height);
        }
        .osp-button {
            border: none;
            outline: none;
            height: 30px;
            min-width: 40px;
            background: var(--theme);
            padding: 0 10px;
            font-size: 14px;
            line-height: 30px;
            text-align: center;
            color: #fff;
            justify-self: start;
            border-radius: 3px;
            cursor: pointer;
            transition: .2s;
        }
        .osp-button:hover {
            opacity: 0.8;
        }
        .osp-button:active {
            opacity: 1;
            background: var(--theme-hover);
        }
        input[type="range"] {
            -webkit-appearance: none;
            width: 200px;
            height: 8px;
            background: -webkit-linear-gradient(var(--theme), var(--theme)) no-repeat #ececec; 
            background-size: 15% 100%;
            border-radius: 4px;
            cursor: pointer;
        }
        input[type="range"]::-ms-thumb {
            background: var(--theme);
        }
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            background: var(--theme);
            height: 15px;
            width: 15px;
            border-radius: 50%;
        }
        input[type="range"]::-moz-range-thumb {
            background: var(--theme);
        }
    </style>   
    <link rel="stylesheet" href="css/index.css"> 
    <body >
        <div class="back-img">
            <img src="img/common_bg.jpg" alt="">
        </div>
        <div class="popup-main">
            <div class="popup-item">
                <p>开启</p>
                <input type="checkbox" name="popup-checkbox" id="open-spine" hidden >
                <label for="open-spine" class="open-spine-label"></label>
            </div>
            <div class="popup-item">
                <p>开启动线(beta)</p>
                <input type="checkbox" name="popup-checkbox" id="open-moveline" hidden>
                <label for="open-moveline" class="open-spine-label"></label>
            </div>
            <!-- <div class="popup-item">
                <p>开启触碰</p>
                <input type="checkbox" name="popup-checkbox" id="open-moveline" hidden>
                <label for="open-moveline" class="open-spine-label"></label>
            </div> -->
            <div class="popup-item">
                <p>选择干员</p>
                <div class="spine-char-select">
                    <input type="text" name="spine-char-select-input" id="spine-char-select-input">
                    <div class="spine-char-select-popup" id="spine-char-select-popup">
                        <!-- 选项模板 -->
                        <!-- <div class="spine-char-select-option">
                            <p>选项1</p>
                        </div> -->
                    </div>
                </div>
            </div>
            <div class="popup-item">
                <p>选择朝向</p>
                <div class="spine-char-select" style="z-index: 0;">
                    <input type="text" name="spine-char-select-input" id="osp-select-direction-input">
                    <div class="spine-char-select-popup" id="osp-select-direction-popup"></div>
                </div>
            </div>
            <!-- <div class="popup-item">
                <div></div>
                <button class="osp-button" id="setting-position">设定初始位置</button>
            </div> -->
            <div class="popup-item">
                <p>设置大小</p>
                <input type="range" min="10" max="50" value="50" id="setting-scale">
            </div>
            <!-- <div class="popup-item">
                <div></div>
                <button class="osp-button" id="char-load">测试小人读取</button>
            </div> -->
            <p id="request-msg"></p>
            <div class="popup-item">
                <div></div>
                <button class="osp-button" id="default-setting">恢复默认设置</button>
            </div>
            <!-- <div class="popup-item">
                <div></div>
                <input type="file" name="" id="char-load" value="E:\ou\QQ机器人\Arknights\google-ospine\spine" webkitdirectory>
            </div> -->
        </div>
        <script src="js/spine-webgl.js"></script>
        <script src="js/spine.js"></script>
        <script src="js/popup.js"></script>
    </body>
</html>
